using NUnit.Framework ;
using System.Security.Policy;

namespace Crawler.Tests
{
	/// <summary>
	/// Tests a url stack
	/// </summary>
	[TestFixture ]
	public class TestUrlStack
	{

		UrlStack u;

		public TestUrlStack()
		{
		}

		[SetUp]
		public void Initialize() {
		    u = new UrlStack(null);
			u.Add(new Url("http://www.yahoo.com"), false);
			u.Add(new Url("http://www.thoughtworks.com"), false);
		}

		[Test]
		public void TestAdd() {
			Assertion.AssertEquals("",2,u.Count);  
		}

		[Test]
		public void TestIsPresent() {
			Assertion.AssertEquals("",true, u.IsPresent(new Url("http://www.yahoo.com")));
			Assertion.AssertEquals("",false, u.IsPresent(new Url("http://www.google.com")));
		}

		[Test]
		public void TestGetNext() {
			Assertion.AssertEquals("",(new Url("http://www.yahoo.com")).Value ,u.GetNext().Value  ); 
			Assertion.AssertEquals("",1,u.Count);  
			Assertion.AssertEquals("",(new Url("http://www.thoughtworks.com")).Value ,u.GetNext().Value  ); 
			Assertion.AssertEquals("",0,u.Count);  
			
		}
	}
}
